<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>Login</title>

<script type="text/javascript" src="js/AjaxRequest.js"></script>
<script type="text/javascript">
//	错误处理的方法
	function onerror(){
		alert("你的操作有误！");
	}

//  实例化ajax对象----生成验证码
function getCheckCode1(showCheckCode,checkCode){
	var loader1=new net.AjaxRequest("getPictureCheckCode.jsp?nocache="+new Date().getTime(),deal_getCheckCode,onerror,"GET");
	showCheckCode.style.display='';
	checkCode.focus();
}

//	回调函数
function deal_getCheckCode(){
	document.getElementById("showCheckCode").innerHTML=this.req.responseText;
}

//  生成并显示验证码
	function showCheckCodeFun(showCheckCode,checkCode){
		showCheckCode.style.display='';
//		if(document.getElementById("resultMessage").innerHTML=="温馨提示：单击验证码输入框，获取验证码！验证码区分大小写"){
			getCheckCode1(showCheckCode,checkCode);	//生成验证码
//		}
		checkCode.focus();
	}

//  隐藏验证码显示框
	function hideCheckCode(){
		showCheckCode.style.display='none';
	}

//  验证验证码是否正确
	function checkCheckCode(inCheckCode){
		if(inCheckCode!=""){
			var loader=new net.AjaxRequest("checkCheckCode.jsp?inCheckCode="+inCheckCode+"&nocache="+new Date().getTime(),deal_checkCheckCode,onerror,"GET");
		}
	}
	
</script>
<style type="text/css">
<!--
#showCheckCode {
	position:absolute;
	left:165px;
	top:30px;
	width:200px;
	height:90px;
	z-index:1;
	background-color:#666666;
}
-->
</style>
</head>
<body>
<form name="dForm" action="" method="post">
<table width="90%" height="90%" border="0" >
  <tr>
  	<td width="20%" height="20" align="right">username:</td>  
  	<td width="30%" height="20" align="left"><label>
  	  <input name="username" type="text" id="username" size="20" maxlength="20">
  	</label></td>
    <td height="20" align="left">&nbsp;</td>
  </tr>
  <tr>
  	<td width="20%" height="20" align="right">password:</td>  
  	<td width="30%" height="20" align="left"><label>
  	  <input name="password" type="password" id="password" size="20" maxlength="20">
  	</label></td>
    <td height="20" align="left">&nbsp;</td>
  </tr>
  <tr>
  	<td width="20%" height="20" align="right">checkcode:</td>  
  	<td width="30%" height="20" align="left">
  	  <input name="checkCode" type="text" id="checkCode" size="20" maxlength="20" title="单击输入验证码">
  	</td>
    <td height="20" align="left"><div id="showCheckCode" ></div></td>
  </tr>
  <tr>
  	<td width="20%" height="20" align="right">
  	  <input type="submit" name="submit" id="submit" value="提交">
  	</td>  
  	<td width="30%" height="20" align="left">
  	  <input type="reset" name="reset" id="reset" value="重置">
  	  </td>
    <td height="20" align="left">&nbsp;</td>
  </tr>
  <tr></tr>
</table>
</form>
</body>
</html>